Portfolio Learn Month 01 Kali Basics

⚙️ Day 5: Understanding Linux Processes

Processes
Linux

A program is static code. A process is that code in action! 🚀


🧠 Program vs. Process

Term Definition State
Program 📄 An executable file stored on the disk. Passive (Doing nothing)
Process 🏃 A program currently running in memory (RAM). Active (Executing tasks)

Every active Process has unique identifiers:

  1. PID: Process ID (Unique number).
  2. USER: Who started it.
  3. %CPU: Processor usage.
  4. %MEM: Memory usage.
  5. COMMAND: The command that started it.

📚 Key Terminologies

Before we dive into commands, let's clear up some terms:

1️⃣ Terminal vs. Shell

2️⃣ Foreground vs. Background


🕵️‍♂️ Viewing Processes: ps & ps aux

1. Basic View (ps)

Shows only processes running in the current shell session.

ps
# Output shows very few processes (usually just bash and ps itself)

2. Detailed View (ps aux)

The gold standard for viewing system activity.

ps aux
# Shows ALL processes from ALL users

Flags Breakdown:


📊 Monitoring Live: Task Manager Style

Want to see what's creating load in real-time?

1. The Classic: top

Updates in real-time.

top
# Press 'q' to quit

2. The Modern: htop

Colorful, interactive, and user-friendly. You can even use your mouse! 🖱️

htop
# A visual upgrade to top

🔐 Processes & Ownership

Who controls the process?

Rule: You can only kill or manage processes you own (unless you represent the "Bank", i.e., root).